/*
 * Pick (for jQuery)
 * version: 1.0 (10/07/2010)
 * @requires any version of jQuery
 *
 * Licensed under the MIT:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright 2010, 2010 Caroline Hill [ mllegeorgesand@gmail.com ]
 *
 * Usage:
 *
 *  jQuery(document).ready(function() {
 *    jQuery('#gallery li').pick(6);
 *  })
 *
 *  The above will randomly pick 6 elements from the wrapped set, and
 *  remove others from the document.
 *
 *  What is returned is the wrapped set of picked elements.
 *  The removed elements are no longer in that set.
 *
 *  Ex:
 *
 *  var how_many = jQuery('#gallery li').pick(6).size(); // Will return 6.
 *
 */
(function(a){a.fn.pick=function(b){var b=b||4;var c=[];var d=this.size();for(var e=0;e<d;e++){c.push(e)}var f=function(a){for(var b,c,d=a.length;d;b=parseInt(Math.random()*d),c=a[--d],a[d]=a[b],a[b]=c);return a};var g=f(c).slice(0,b);return this.each(function(b){if(a.inArray(b,g)===-1){a(this).remove()}}).filter(function(){if(this.parentNode===null){return false}else{return true}})}})(jQuery)